/* 
 *  Copyright 2012 CodeMagi, Inc.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.codemagi.login.model;

import java.util.Date;

/**
 * The IUser interface defines methods and attributes that are common to users
 * within the CodeMagi web application framework.
 *
 *  @version 1.0
 *  @author August Detlefsen for CodeMagi, Inc.
 */
public interface IUser {

    //GETTERS AND SETTERS -----------------------------------------------------

    public void setId(Integer newValue) ;

    public Integer getId() ;

    public Boolean getOnline();

    public Date getDateExpires();

    public void setLastLogin(Date newValue);

    public void setUsername(String newValue);
    
    public String getUsername();

    public void setNewPassword(String newValue);


    public void setFirstName(String newValue);

    public String getFirstName();

    public void setLastName(String newValue);

    public String getLastName();

    public void setEmail(String newValue);

    public String getEmail();

    public void setPhone(String newValue);

    public String getPhone();

    public String getSsoHash();

    public void setFailedLogins(Integer newValue);

    public Integer getFailedLogins();

    public void setLockedUntil(Date newValue);

    public Date getLockedUntil();

    public void setUpdateRequired(Boolean newValue);

    public Boolean getUpdateRequired();

    public void setRecoveryHash(String newValue);

    public String getRecoveryHash();

    public void setRecoveryExpiration(Date newValue);

    public Date getRecoveryExpiration();


    //SPECIAL GETTERS AND SETTERS ---------------------------------------------

    public boolean isAuthenticated() ;

    public boolean isSuperuser() ;

    public boolean isInGroup(String groupName) ;

    public boolean isInGroup(Integer groupId) ;

    public String getName();

    //LOGIN RELATED -----------------------------------------------------------

    public void addGroup(Group group);

    public void removeGroup(Group group);

    public boolean authenticate(String password);

}
